package com.jt.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.PipedReader;

/**
 * @author 张琪
 * @date 2020/12/1
 * @describe
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ImageVO {
    //    0: 表示没有错误. 否则出错
    private Integer error = 0;
    private String url;     //  图片浏览的网络地址(虚拟地址)
    private Integer width;
    private Integer height;

    public static ImageVO fault() {
        return new ImageVO(1, null, null, null);
    }

    public static ImageVO success(String url, Integer width, Integer height) {
        return new ImageVO(0, url, width, height);
    }

}
